package com.tanhua.domain.Enum;

/**
 * @author YiJian
 * @date 2021/8/6 12:15
 */
public enum QuestionnaireLeverEnum {
	LOW(1) {
		@Override
		public String toString() {
			return "初级";
		}
	},//初级

	MIDDLE(2) {
		@Override
		public String toString() {
			return "中级";
		}
	},//中级

	HIGH(3) {
		@Override
		public String toString() {
			return "高级";
		}
	};//高级
	private int code;

	QuestionnaireLeverEnum(int code) {
		this.code = code;
	}


	public int getCode() {
		return code;
	}


	/**
	 * 根据传入参数查询问卷等级
	 *
	 * @param lever
	 * @return
	 */

	public static CharacterEnum getLever(int lever) {
		if (lever <= 0) {
			return null;
		}

		for (CharacterEnum result : CharacterEnum.values()) {
			if (result.getCode() == (lever)) {
				return result;
			}
		}
		return null;

	}
}
